while 循环
package com.jc;

public class Ssd {

	public static void main(String[] args) {
		// 输出 1 - 10 的数字
		int i = 1;
		
		System.out.println(i);
		
		//while(条件){  }
		while(i<=10) {
			System.out.println(i);
			
			i++;
		}
	}

}

package com.jc;

public class TenLine {
	public static void main(String[] args) {
		// 输出 10 行  Hello Java
		
		int i = 0;  //注意初值的选择
		String s = "Hello Java";
		
		while(i<10) {
			i++;
			
			System.out.println(i+"、"+s);
		}
	}
}

1 - 100的数
package com.jc;

public class NumAdd {

	public static void main(String[] args) {
		// 1 + 2 + ... + 100 = ?
		int i = 1;
		int sum = 0; // 和
		
		while(i<=100) {
			sum += i;  // sum = sum + i
			i++;
		}
		
		System.out.println(sum);

	}

}

package com.jc;

public class Factor {

	public static void main(String[] args) {
		// 求阶乘 5！=?
		int i = 1;
		long f = 1;  // 阶乘
		
		while (i <= 5) {
			f *= i; // f = f * i
			
			i++;
			
		}
		
		System.out.println(f);
		System.out.println(i);

	}

}

package com.jc;

public class AddNum {
	public static void main9(String[] args) {
		//求 1+3+5+7+。。。+99的和(100以内奇数的和) 2500
		int i =1;
		int sum = 0;
		
		while(i<=100) {
			sum += i;
			
			i +=2;
		}
		System.out.println(sum);
	}
}

package com.jc;

public class Letter {

	public static void main(String[] args) {
		// 输出所有大写字母
		char c = 'Z';
		String s = "";
		
		while(c >= 'A') {
			s += c;
			
			c--;
		}
		
		System.out.println(s);
		

	}

}
package com.jc;

public class Once {

	public static void main(String[] args) {
		// 输出一次  Hello Java
		String s = "Hello Java";
		boolean isPrint = true;
		
		while(isPrint) {
			System.out.println(s);
			
			isPrint = !isPrint;
		}

	}

}

